load("//:build_variables.bzl", "COPTS")
load("//tools/lint:linters.bzl", "clang_tidy_test")
load("@grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")

package(
    default_visibility = ["//:android_cuttlefish"],
)

cc_binary(
    name = "gnss_grpc_proxy",
    srcs = [
        "gnss_grpc_proxy.cpp",
    ],
    copts = COPTS,
    deps = [
        "//libbase",
        "//cuttlefish/common/libs/fs",
        "//cuttlefish/host/libs/config:cuttlefish_config",
        "//cuttlefish/host/libs/config:logging",
        ":libcvd_gnss_grpc_proxy",
        "@gflags",
        "@grpc//:grpc",
        "@grpc//:grpc++",
        "@grpc//:grpc++_reflection",
    ],
)

clang_tidy_test(
    name = "gnss_grpc_proxy_clang_tidy",
    srcs = [":gnss_grpc_proxy"],
    tags = ["clang_tidy", "clang-tidy"],
)

proto_library(
    name = "gnss_grpc_proxy_proto",
    srcs = ["gnss_grpc_proxy.proto"],
)

cc_proto_library(
    name = "gnss_grpc_proxy_cc_proto",
    deps = [":gnss_grpc_proxy_proto"],
)

cc_grpc_library(
    name = "libcvd_gnss_grpc_proxy",
    srcs = [":gnss_grpc_proxy_proto"],
    deps = [
        ":gnss_grpc_proxy_cc_proto",
        "@grpc//:grpc++",
    ],
    grpc_only = True,
)
